import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home.vue'
import Console from '@/components/dashboard/console.vue'
import User from '@/components/user/User.vue'
import Menu from '@/components/user/Menu.vue'
import Role from '@/components/user/Role.vue'
import BasicForm from '@/components/form/basic-form.vue'
import AdvancedForm from '@/components/form/advanced-form.vue'
import StepForm from '@/components/form/step-form.vue'
import Detail from '@/components/form/detail.vue'
import BasicList from '@/components/list/basic-list.vue'
import CardList from '@/components/list/card-list.vue'
import UserList from '@/components/list/user-list.vue'
import GoodsList from '@/components/list/goods-list.vue'
import TableList from '@/components/list/table-list.vue'
import SearchArticle from '@/components/search/search-article.vue'
import SearchProjects from '@/components/search/search-projects.vue'
import SearchApps from '@/components/search/search-apps.vue'
import Basic from '@/components/profile/basic.vue'
import Advanced from '@/components/profile/advanced.vue'
import Success from '@/components/result/success.vue'
import Fail from '@/components/result/fail.vue'
import Exception403 from '@/components/exception/403.vue'
import Exception404 from '@/components/exception/404.vue'
import Exception500 from '@/components/exception/500.vue'
import SeetingUser from '@/components/setting/user.vue'
import SeetingAccount from '@/components/setting/account.vue'
import Login from '@/components/login/Login.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home,
    children:[
      {path: 'dahsboard/console',name: 'console',component: Console},
      {path: 'system/user', name: 'user',component: User},
      {path: 'system/menu',name: 'menu',component: Menu},
      {path: 'system/role', name: 'role',component: Role},
      {path: 'form/basic-form',name: 'basic-form',component: BasicForm},
      {path: 'form/advanced-form',name: 'advanced-form',component: AdvancedForm},
      {path: 'form/step-form',name: 'step-form',component: StepForm},
      {path: 'form/detail',name: 'detail',component: Detail},
      {path: 'list/basic-list',name: 'basic-list',component: BasicList},
      {path: 'list/card-list',name: 'card-list',component: CardList},
      {path: 'list/user-list',name: 'user-list',component: UserList},
      {path: 'list/goods-list',name: 'goods-list',component: GoodsList},
      {path: 'list/table-list',name: 'table-list',component: TableList},
      {path: 'search/search-article',name: 'search-article',component: SearchArticle},
      {path: 'search/search-projects',name: 'search-projects',component: SearchProjects},
      {path: 'search/search-apps',name: 'search-apps',component: SearchApps},
      {path: 'profile/basic',name: 'basic',component: Basic},
      {path: 'profile/advanced',name: 'advanced',component: Advanced},
      {path: 'result/success',name: 'success',component: Success},
      {path: 'result/fail',name: 'fail',component: Fail},
      {path: 'exception/403',name: '403',component: Exception403},
      {path: 'exception/404',name: '404',component: Exception404},
      {path: 'exception/500',name: '500',component: Exception500},
      {path: 'setting/user',name: 'setting-user',component: SeetingUser},
      {path: 'setting/account',name: 'setting-account',component: SeetingAccount}
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: Login,
  }
]

const router = createRouter({
  routes,
  history: createWebHistory(process.env.BASE_URL),
  scrollBehavior() {
    return { top: 0 }
  }
})

export default router
